<?php
include("include/config.inc.php");
if(!isset($_SESSION['s_activId']))
{
  header("location:checklogin.php");
}

$maxUnloadInvNo = 1;
$invoiceNo = isset($_GET['invoiceNo']) ? $_GET['invoiceNo'] : 0;
 
$k=0;  
$branchArray = array();
$selectBranch = "SELECT branchId,branchName
                   FROM branch
                  WHERE branchId != ".$_SESSION['ses_branchId'];
$selectBranchRes = mysql_query($selectBranch);
while($branchRow = mysql_fetch_array($selectBranchRes))
{
	$branchArray['branchId'][$k]   = $branchRow['branchId'];
	$branchArray['branchName'][$k] = $branchRow['branchName'];
	$k++;
}
/////////invoce selcetion : Start
$m=0;
$loadArray = array();
$selectBranch = "SELECT loadingInvoiceId,invoiceNo
                   FROM loadinginvoice";
$selectBranchRes = mysql_query($selectBranch);
while($branchRow = mysql_fetch_array($selectBranchRes))
{
	$loadArray['loadingInvoiceId'][$m]   = $branchRow['loadingInvoiceId'];
	$loadArray['invoiceNo'][$m]          = $branchRow['invoiceNo'];
	$m++;
}

include("./bottom.php");
$smarty->assign("branchArray",$branchArray);
$smarty->assign("loadArray",$loadArray);
$smarty->assign("invoiceNo",$invoiceNo);
$smarty->display('unloadingregister.tpl');
?>